﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MyabpDDD.Demo.Application.FuelmanagementtableLY;
using MyabpDDD.Demo.Application.FuelmanagementtableLY.Dto;
using MyCompany.MyProject.Models;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace MyabpDDD.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class YoufeiController : ControllerBase
    {
        private static readonly string[] Summaries = new[]
        {
            "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
        };
        private readonly IFuelmanagementtableLyService service;
        public YoufeiController(IFuelmanagementtableLyService service)
        {
            this.service = service;
        }
        [HttpGet]
        public ActionResult QueryStudentAll(int pageIndex, int pageSize, string chepai, int? jid)
        {
            var list=service.QueryStudentAll(pageIndex, pageSize, chepai, jid);
            return Ok(list);
        }
        [HttpPost]
        public async Task<Fuelmanagementtable> OwnerManaInfo(FuelmanagementtableLyDto owner)
        {
            return await service.Inser(owner);
        }
        [HttpGet]
        public async Task Delete(int id)
        {
            await service.Delete(id);
        }
        [HttpGet]
        public ActionResult Get(int id)
        {
            return Ok(service.Get(id));
        }
        [HttpGet]
        public ActionResult SelectDel(string ids)
        {
            return Ok(service.SelectDel(ids));
        }
        //[HttpPost]

        //public  Task<Fuelmanagementtable> Inser(FuelmanagementtableLyDto dto)
        //{
        //    return  service.Inser(dto);
        //}
    }
    
}

